package com.ttg.web.dao.Impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ttg.model.mapper.QyyxCustGroupMapper;
import com.ttg.model.pojo.BankCardDataInfo;
import com.ttg.model.pojo.QyyxCustGroup;
import com.ttg.web.dao.QyyxCustGroupDao;
import org.springframework.stereotype.Repository;
import org.springframework.util.CollectionUtils;

import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

@Repository
public class QyyxCustGroupDaoImpl extends ServiceImpl<QyyxCustGroupMapper, QyyxCustGroup> implements QyyxCustGroupDao {

    @Override
    public Map<String, Long> existsMap(List<Map<String, String>> existsWhere) {
        if (CollectionUtils.isEmpty(existsWhere)) {
            return Collections.emptyMap();
        }
        Map<String, Long> rsMap = new HashMap<>();
        for (QyyxCustGroup qyyxCustGroup : baseMapper.existsMap(existsWhere)) {
            rsMap.put(qyyxCustGroup.getCstScId() + qyyxCustGroup.getCstGroupNo(), qyyxCustGroup.getId());
        }

        return rsMap;
    }

    @Override
    public void truncate() {
        baseMapper.truncate();
    }
}
